package com.glsc.ngateway.common.api.flowable.dto.task;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.glsc.ngateway.common.api.common.dto.BaseEntityDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.MappedSuperclass;
import java.time.LocalDateTime;


/**
 * @author xuchang
 */
@ToString(callSuper = true)
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
@MappedSuperclass
public abstract class FlowFormBaseEntityDto extends BaseEntityDto {

    private static final long serialVersionUID = 5042234091646578270L;

    @ApiModelProperty(name = "唯一编号")
    private String processId;

    @ApiModelProperty(name = "流程名称")
    private String processTitle;

    @ApiModelProperty(name = "紧急程度")
    private String flowUrgentLevel;

    @ApiModelProperty(name = "申请日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime processCreateTime;

    @ApiModelProperty(name = "申请人")
    private String flowCreateOperatorName;

    @ApiModelProperty(name = "发起人账户")
    private String flowCreateOperatorAccount;

    @ApiModelProperty(name = "申请人部门")
    private String flowCreatorDepartment;

    @ApiModelProperty(name = "申请人公司")
    private String flowCreatorCompany;

    @ApiModelProperty(name = "系统名称，从it网关取")
    private String systemName;

    @ApiModelProperty(name = "系统名称，从it网关取，后续关联团队人员")
    private String systemCode;

    @ApiModelProperty(name = "系统管理员姓名")
    private String systemAdminName;

    @ApiModelProperty(name = "系统管理员账户")
    private String systemAdminAccount;

    @ApiModelProperty(name = "流程状态")
    private String status;

    @ApiModelProperty(name = "是否完成0 未完成 1已完成")
    private int isClose;

}
